<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.electric.common.Contains,com.google.gson.Gson"%>
<%@ include file="/WEB-INF/jsp/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/WEB-INF/jsp/common/importHead.jsp"%>
<%@ include file="/WEB-INF/jsp/common/importCommonCss.jsp"%>
<link href="${basePath }/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen" />
<style>
	#searchForm div.input-prepend select{
		margin: 0;
	}
	
	#searchForm div.input-prepend div.input-append{
		margin: 0;
	}
</style>
</head>
<body>
	<%@ include file="/WEB-INF/jsp/common/navi.jsp" %>
	<div style="float: left;margin-left: 25px;" id="contentDiv">
		<script>
			document.getElementById("contentDiv").style.width = document.body.offsetWidth - 250 + "px";
		</script>
	
		<ul class="breadcrumb" style="margin-bottom: 5px;">
	      <li><a href="${basePath }/index">首页</a><span class="divider">/</span></li>
	      <li class="active">故障记录管理</li>
	  	</ul>
	  	
	  	<!-- 内容 -->
		<ul class="nav nav-pills">
	      <li class="active"><a href="javascript:add();">新增故障记录</a></li>
	      <li class="active pull-right"><a href="javascript:showSearch();">查询</a></li>
		</ul>
		
	  	<form action="${basePath }/repairRecord/list" method="post" id="searchForm" class="navbar-form navbar-right hide">
		  	<div class="row-fluid">
				<div class="input-prepend span4">
				    <span class="add-on">户名</span>
				    <input class="span9" id="customerName" name="customerName" type="text" placeholder="模糊查询户号、户名" title="模糊查询户号、户名" />
				</div>
				<div class="input-prepend span4">
				    <span class="add-on">故障类型</span>
				    <select id="repairType" name="repairType" style="width: 130px;">
				    	<option value="">----</option>
					    <c:forEach items="${allRepairType }" var="c">
					    	<option value="${c.seqId }">${c.repairType }</option>
					    </c:forEach>
				    </select>
				</div>
				<div class="input-prepend span4">
				    <span class="add-on">电压等级</span>
				    <select id="voltageLevel" name="voltageLevel" style="width: 130px;">
				    	<option value="">----</option>
					    <c:forEach items="${allVoltageLevel }" var="c">
					    	<option value="${c.seqId }">${c.value }</option>
					    </c:forEach>
				    </select>
				</div>
			</div>
			
			<div class="row-fluid">
				<div class="input-prepend span4">
				    <span class="add-on" style="float: left">故障日期【开始】</span>
				    <div class="input-append date" id="failureDateStart" data-date-format="yyyy-mm-dd">
					    <input style="width: 6em;" name="failureDateStart" size="16" type="text" value="" readonly />
					    <span class="add-on"><i class="icon-th"></i></span>
					    <span class="add-on"><i class="icon-remove"></i></span>
					</div>
				</div>
				<div class="input-prepend span4">
				    <span class="add-on" style="float: left">故障日期【结束】</span>
				    <div class="input-append date" id="failureDateEnd" data-date-format="yyyy-mm-dd">
					    <input style="width: 6em;" name="failureDateEnd" size="16" type="text" value="" readonly />
					    <span class="add-on"><i class="icon-th"></i></span>
					    <span class="add-on"><i class="icon-remove"></i></span>
					</div>
				</div>
			</div>
			
			<div class="row-fluid">
				<div class="input-prepend span4">
				    <span class="add-on" style="float: left">恢复日期【开始】</span>
				    <div class="input-append date" id="startDate" data-date-format="yyyy-mm-dd">
					    <input style="width: 6em;" name="startDate" size="16" type="text" value="" readonly />
					    <span class="add-on"><i class="icon-th"></i></span>
					    <span class="add-on"><i class="icon-remove"></i></span>
					</div>
				</div>
				<div class="input-prepend span4">
				    <span class="add-on" style="float: left">恢复日期【结束】</span>
				    <div class="input-append date" id="endDate" data-date-format="yyyy-mm-dd">
					    <input style="width: 6em;" name="endDate" size="16" type="text" value="" readonly />
					    <span class="add-on"><i class="icon-th"></i></span>
					    <span class="add-on"><i class="icon-remove"></i></span>
					</div>
				</div>
			</div>
		  	
		  	<button type="button" class="btn btn-default" onclick="list(1);">查询</button>
		  	<button type="button" class="btn btn-default" onclick="searchForm.reset();">重置</button>
		    <input name="pageNum" type="hidden" value="${page.current }" />
	  	</form>
	  	
	  	<table class="table table-hover">
		  <thead>
		    <tr class="success">
		      <th width="90px">故障日期</th>
		      <th width="90px">恢复日期</th>
		      <th>户号</th>
		      <th>户名</th>
		      <th width="100px">故障类型</th>
		      <th width="60px">电压等级</th>
		      <th width="250px">操作</th>
		    </tr>
		  </thead>
		  <tbody id="contentTBody">
		  	<%@ include file="/WEB-INF/jsp/repairRecord/contentTBody.jsp"%>
		  </tbody>
		</table>
		
		<div id="pagination">
		</div>
	</div>
	<div class="clearfix"></div>
	<%@ include file="/WEB-INF/jsp/common/importCommonJs.jsp"%>
	<script type="text/javascript" src="${basePath }/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
	<script type="text/javascript" src="${basePath }/js/locales/bootstrap-datetimepicker.fr.js" charset="UTF-8"></script>
	<script type="text/javascript" src="${basePath }/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
	<script>
		// 定义参数
		var current = ${page.current};
		var pages = ${page.pages};
		var total = ${page.total};
		var pageSize = ${page.size};

		var keyArray = eval('(<% out.print(new Gson().toJson(Contains.VOLTAGE_LOSS_PARAM)); %>)');
		
		var nameMap = {};
		
		for(var i = 0;i < keyArray.length;i++){
			var temp = keyArray[i];
			for(var j = 0;j < temp.length;j++){
				nameMap[temp[j]] = "";
			}
		}
		
		var emptyNameMap = nameMap;
		
		// 定义方法
		var list = function(page){
			console.warn("未实现list方法");
		};
		
		var preview = function(seqId){
			console.warn("未实现preview方法");
		};
		
		var add = function(){
			console.warn("未实现add方法");
		};
		
		var modify = function(seqId){
			console.warn("未实现modify方法");
		};
		
		var save = function(seqId){
			console.warn("未实现save方法");
		};
		
		var del = function(seqId){
			console.warn("未实现del方法");
		};
		
		var chooseCustomer = function(){
			console.warn("未实现chooseCustomer方法");
		};
		
		var customerList = function(pageNum,seqId){
			console.warn("未实现customerList方法");
		};
		
		var selectCustomer = function(oldSeqId,newSeqId){
			console.warn("未实现selectCustomer方法");
		};
		
		var showSearch = function(){
			var $e = $("#searchForm");
			if($e.is(":hidden")){
				$e.slideDown();
			}
			else{
				$e.slideUp();
			}
		};
		
		$(function(){
			$('#startDate').datetimepicker({
				language: 'zh-CN',
		        weekStart: 1,
		        todayBtn:  1,
				autoclose: 1,
				todayHighlight: 1,
				startView: 2,
				minView: 2,
				forceParse: 0
		    });
			
			$('#endDate').datetimepicker({
				language: 'zh-CN',
		        weekStart: 1,
		        todayBtn:  1,
				autoclose: 1,
				todayHighlight: 1,
				startView: 2,
				minView: 2,
				forceParse: 0
		    });
			
			$('#failureDateStart').datetimepicker({
				language: 'zh-CN',
		        weekStart: 1,
		        todayBtn:  1,
				autoclose: 1,
				todayHighlight: 1,
				startView: 2,
				minView: 2,
				forceParse: 0
		    });
			
			$('#failureDateEnd').datetimepicker({
				language: 'zh-CN',
		        weekStart: 1,
		        todayBtn:  1,
				autoclose: 1,
				todayHighlight: 1,
				startView: 2,
				minView: 2,
				forceParse: 0
		    });
		});
	</script>
	
	<script type="text/javascript" src="${basePath }/js/repairRecord.js"></script>
	<script type="text/javascript" src="${basePath}/js/jQuery-File-Upload-master/vendor/jquery.ui.widget.js"></script>
	<script type="text/javascript" src="${basePath}/js/jQuery-File-Upload-master/jquery.iframe-transport.js"></script>
	<script type="text/javascript" src="${basePath}/js/jQuery-File-Upload-master/jquery.fileupload.js"></script>
	<script type="text/javascript" src="${basePath}/js/jQuery-File-Upload-master/jquery.fileupload-process.js"></script>
	
</body>
</html>